HACK for GCC 4.x
authorØyvind Kolås <ok@src.gnome.org>
Thu, 1 Sep 2005 14:14:02 +0000 (14:14 +0000)
committerØyvind Kolås <ok@src.gnome.org>
Thu, 1 Sep 2005 14:14:02 +0000 (14:14 +0000)
ChangeLog
babl/babl-internal.h

index a64f0ab9072a134ed183b793ff2923b97926c8cc..6fbdc51566bc386c58f9a4c6a3d9e33d9082fee5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-01  Øyvind Kolås  <pippin@gimp.org>
+
+       * babl/babl-internal.h: HACK statically define BablDb *db,
+       for all internal translation units.
+
 2005-09-01  Øyvind Kolås  <pippin@gimp.org>
 
        Added a 128 item hashtable to each object list.
index df05e5249c2afc74470882cdbe8432ef92c5c6f0..cacff5e20c30f000f756712ba0de95cb4e67a8c2 100644 (file)
@@ -65,6 +65,16 @@ Babl * babl_extension_quiet_log     (void);
 
 void   babl_core_init               (void);
 
+/* FIXME: nasty,. including the symbol even in files where it is
+ * not needed,. and a dummy function to use it in those cases
+ */
+static BablDb *db=NULL;
+static void hack_hack (void)
+{
+  if (db==NULL)
+    db=NULL;
+}
+
 /**** LOGGER ****/
 #include <stdarg.h>
 
@@ -93,6 +103,8 @@ real_babl_log (const char *file,
   va_end (varg);
 
   fprintf (stdout, "\n");
+  return;
+  hack_hack ();
 }
 
 #define babl_log(args...)                               \
@@ -121,15 +133,12 @@ while(0)
             :BABL_CLASS_TYPE_IS_VALID(((Babl*)(obj))->class_type)  \
 )
 
-
 extern int   babl_hmpf_on_name_lookups;
 
 const char  *babl_class_name     (BablClassType klass);
 void         babl_internal_init    (void);
 void         babl_internal_destroy (void);
 
-extern BablDb *db;
-
 #define BABL_DEFINE_EACH(type_name)                           \
 void                                                          \
 babl_##type_name##_each (BablEachFunction  each_fun,          \
@@ -185,7 +194,6 @@ babl_##type_name (const char *name)                             \
 
 #define BABL_DEFINE_INIT(type_name)                           \
                                                               \
-static BablDb *db=NULL;                                       \
                                                               \
 void                                                          \
 babl_##type_name##_init (void)                                \